primes → sieve(from(s(s(0))))
from(X) → cons(X, from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → Y
if(true, X, Y) → X
if(false, X, Y) → Y
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, filter(X, sieve(Y)))
primes: empty set
sieve: {1}
from: {1}
s: {1}
0: empty set
cons: {1}
head: {1}
tail: {1}
if: {1}
true: empty set
false: empty set
filter: {1, 2}
divides: {1, 2}
↳ CSR
↳ CSRInnermostProof
primes → sieve(from(s(s(0))))
from(X) → cons(X, from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → Y
if(true, X, Y) → X
if(false, X, Y) → Y
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, filter(X, sieve(Y)))
primes: empty set
sieve: {1}
from: {1}
s: {1}
0: empty set
cons: {1}
head: {1}
tail: {1}
if: {1}
true: empty set
false: empty set
filter: {1, 2}
divides: {1, 2}
The CSR is orthogonal. By [10] we can switch to innermost.
↳ CSR
↳ CSRInnermostProof
↳ CSR
↳ CSDependencyPairsProof
primes → sieve(from(s(s(0))))
from(X) → cons(X, from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → Y
if(true, X, Y) → X
if(false, X, Y) → Y
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, filter(X, sieve(Y)))
primes: empty set
sieve: {1}
from: {1}
s: {1}
0: empty set
cons: {1}
head: {1}
tail: {1}
if: {1}
true: empty set
false: empty set
filter: {1, 2}
divides: {1, 2}
Innermost Strategy.
Using Improved CS-DPs we result in the following initial Q-CSDP problem.
↳ CSR
↳ CSRInnermostProof
↳ CSR
↳ CSDependencyPairsProof
↳ QCSDP
↳ QCSDependencyGraphProof
PRIMES → SIEVE(from(s(s(0))))
PRIMES → FROM(s(s(0)))
FILTER(s(s(X)), cons(Y, Z)) → IF(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
TAIL(cons(X, Y)) → Y
IF(true, X, Y) → X
IF(false, X, Y) → Y
from(s(X))
filter(s(s(X)), Z)
filter(X, sieve(Y))
sieve(Y)
s on positions {1}
from on positions {1}
filter on positions {1, 2}
sieve on positions {1}
cons on positions {1}
TAIL(cons(X, Y)) → U(Y)
IF(true, X, Y) → U(X)
IF(false, X, Y) → U(Y)
U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
U(filter(x_0, x_1)) → U(x_0)
U(filter(x_0, x_1)) → U(x_1)
U(sieve(x_0)) → U(x_0)
U(cons(x_0, x_1)) → U(x_0)
U(from(s(X))) → FROM(s(X))
U(filter(s(s(X)), Z)) → FILTER(s(s(X)), Z)
U(filter(X, sieve(Y))) → FILTER(X, sieve(Y))
U(sieve(Y)) → SIEVE(Y)
primes → sieve(from(s(s(0))))
from(X) → cons(X, from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → Y
if(true, X, Y) → X
if(false, X, Y) → Y
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, filter(X, sieve(Y)))
primes
from(x0)
head(cons(x0, x1))
tail(cons(x0, x1))
if(true, x0, x1)
if(false, x0, x1)
filter(s(s(x0)), cons(x1, x2))
sieve(cons(x0, x1))
↳ CSR
↳ CSRInnermostProof
↳ CSR
↳ CSDependencyPairsProof
↳ QCSDP
↳ QCSDependencyGraphProof
↳ QCSDP
↳ QCSDPSubtermProof
U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
U(filter(x_0, x_1)) → U(x_0)
U(filter(x_0, x_1)) → U(x_1)
U(sieve(x_0)) → U(x_0)
U(cons(x_0, x_1)) → U(x_0)
primes → sieve(from(s(s(0))))
from(X) → cons(X, from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → Y
if(true, X, Y) → X
if(false, X, Y) → Y
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, filter(X, sieve(Y)))
primes
from(x0)
head(cons(x0, x1))
tail(cons(x0, x1))
if(true, x0, x1)
if(false, x0, x1)
filter(s(s(x0)), cons(x1, x2))
sieve(cons(x0, x1))
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
U(filter(x_0, x_1)) → U(x_0)
U(filter(x_0, x_1)) → U(x_1)
U(sieve(x_0)) → U(x_0)
U(cons(x_0, x_1)) → U(x_0)
↳ CSR
↳ CSRInnermostProof
↳ CSR
↳ CSDependencyPairsProof
↳ QCSDP
↳ QCSDependencyGraphProof
↳ QCSDP
↳ QCSDPSubtermProof
↳ QCSDP
↳ PIsEmptyProof
primes → sieve(from(s(s(0))))
from(X) → cons(X, from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → Y
if(true, X, Y) → X
if(false, X, Y) → Y
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, filter(X, sieve(Y)))
primes
from(x0)
head(cons(x0, x1))
tail(cons(x0, x1))
if(true, x0, x1)
if(false, x0, x1)
filter(s(s(x0)), cons(x1, x2))
sieve(cons(x0, x1))